home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-01-14 | 1.3 KB | 46 lines | [TEXT/MPS ] |
- /* _________________________________________________________________________________________________________ //
- Copyright © 1992 Apple Computer, Inc. All rights reserved.
- Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
- Originator: Kent Sandvik
- Date: 9/20/92
- Revision comments are at the end of this file.
- ---
- TKeyMap is a KeyMap utility class.
- TKeyMapTest.cp contains the test functions for the TKeyMap class.
- _________________________________________________________________________________________________________ */
-
- #ifndef _KEYMAP_
- #include "KeyMap.h"
- #endif
-
- // This test will scan continously for key strokes, and print them
- // out on the screen. Terminate this with command-. (MPW tool or another
- // more decent environment).
-
- void main(void)
- {
- TKeyMap myKeyMap;
-
- // OK, run forever
- for (;;)
- {
- if (myKeyMap.OptionKeyDown())
- cout << "Option Key is down\n";
- if (myKeyMap.CommandKeyDown())
- cout << "Command Key is down\n";
- if (myKeyMap.ShiftKeyDown())
- cout << "Shift Key is down\n";
- if (myKeyMap.IsKeyDown(0x31)) // 0x31 = space bar
- cout << "Space Bar is down\n";
- }
- }
-
-
- // _________________________________________________________________________________________________________ //
-
-
- /* Change History (most recent last):
- No Init. Date Comment
- 1 khs 9/20/92 New file
- */
-